<?xml version="1.0" encoding="utf-8"?>
<openerp>
	<data>
		<record id="view_param_payable_aging_report" model="ir.ui.view">
			<field name="name">Payable Aging Report</field>
			<field name="model">param.payable.aging.report</field>
			<field name="type">form</field>
			<field name="arch" type="xml">
				<form string="AP Aging Report">
					<group>
						<field name="date_to"/>
						<field name="target_move"/>
					</group>
					<notebook colspan="4">
						<page string="Supplier">
							<group>
								<field name="report_type" attrs="{'invisible': [('report_type','=','payable')]}"/>
								<field name="supplier_search_vals"/>
								<field name="filter_selection"/>
								<field name="partner_default_from" attrs="{'invisible': [('filter_selection','!=','def')], 'required': [('filter_selection','=','def')]}"
									options='{"quick_create": false}'
									domain="[('supplier','=',True), ('is_company','=',True)]" context="{'search_default_supplier':1,'default_supplier':1,'default_customer':0}"/>
								<field name="partner_default_to" attrs="{'invisible': [('filter_selection','!=','def')], 'required': [('filter_selection','=','def')]}"
									options='{"quick_create": false}'
									domain="[('supplier','=',True), ('is_company','=',True)]" context="{'search_default_supplier':1,'default_supplier':1,'default_customer':0}"/>
								<field name="partner_input_from"
									attrs="{'invisible': [('filter_selection','!=','input')], 'required': [('filter_selection','=','input')]}"
									/>
								<field name="partner_input_to"
									attrs="{'invisible': [('filter_selection','!=','input')], 'required': [('filter_selection','=','input')]}"/>
								<field name="partner_ids" domain="[('supplier','=',True), ('is_company','=',True)]"
									attrs="{'invisible': [('filter_selection','!=','selection')], 'required': [('filter_selection','=','selection')]}" nolabel="1">
									<tree>
										<field name="name"/>
										<field name="ref"/>
									</tree>
								</field>
							</group>
						</page>
					</notebook>
					<footer>
						<button name="generate" string="Print as PDF" type="object" default_focus="1" class="oe_highlight"/>
	                    or
	                    <button name="print_report" string="Print as XLS" type="object" class="oe_highlight" context="{'xls_output':1}"/>
		            	or
	                    <button string="Cancel" class="oe_link" special="cancel"/>
					</footer>
				</form>
			</field>
		</record>

		<record id="payable_aging_result_csv_view" model="ir.ui.view">
			<field name="name">Payable Aging Report</field>
			<field name="model">param.payable.aging.report</field>
			<field name="type">form</field>
			<field name="arch" type="xml">
				<form string="Report Options">
					<field name="data" filename="filename" colspan="4" readonly="1"/>
					<field name="filename" invisible="1"/>
					<footer>
						<button string="Cancel" class="oe_link" special="cancel"/>
					</footer>>
				</form>
			</field>
		</record>

		<record id="action_param_payable_aging_report" model="ir.actions.act_window">
			<field name="name">Payable Aging Report</field>
			<field name="type">ir.actions.act_window</field>
			<field name="res_model">param.payable.aging.report</field>
			<field name="view_type">form</field>
			<field name="view_mode">form</field>
			<field name="view_id" ref="view_param_payable_aging_report"/>
			<field name="target">new</field>
			<field name="help">This menu print AP Aging Report.</field>
		</record>
		
		<menuitem name="Payable Aging" parent="menu_ap_report"
			action="action_param_payable_aging_report" id="menu_payable_aging" sequence="10"/>
		
	</data>
</openerp>
